/*
 * GetFilelistConnection.java
 *
 * Created on 22 September 2006, 11:16
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package hubsniffer.conn;

import libjdc.dc.protocol.Protocol;
import hubsniffer.DCHub;
import libjdc.dc.client.User;
import java.io.IOException;
import java.io.UnsupportedEncodingException;

/**
 *
 * @author root
 */
public class GetFilelistConnection extends HubConnection{
    
    /** Creates a new instance of GetFilelistConnection */
    public GetFilelistConnection(DCHub hub,User me) {
        super(hub,me);
    }
    
    public void sendConnectToMe(User other) throws UnsupportedEncodingException, IOException, InterruptedException{
        DCUserConnection conn = new DCUserConnection(/*super.hub,*/user,other);
        conn.connect();
        Object[] obj ={ other.getUserInfo().getNick(),conn.getHost(),conn.getPort()+""};
        
        sendRaw( Protocol.CONNECTTOME_PARSER.format(obj) );
    }
}
